import Vue from 'vue';
import Router from 'vue-router';
import HelloRedPulse from './views/HelloRedPulse.vue';
import Say from './views/Say.vue';
import Updata from './views/Updata.vue';
import NotUpdata from './views/NotUpdata.vue';

Vue.use(Router);

const router =  new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'hello',
      component: HelloRedPulse,
      meta: {
        alive: true,
      },
    },
    {
      path: '/say',
      name: 'say',
      component: Say,
    },
    {
      path: '/updata',
      name: 'updata',
      component: Updata,
      meta: {
        alive: true,
      },
    },
    {
      path: '/notUpdata',
      name: 'notUpdata',
      component: NotUpdata,
      meta: {
        alive: true,
      },
    },
  ],
});

router.beforeEach( (to, from, next) => {
  next();
});

export default router;